package com.gzh.teaching.model.vo;

import com.gzh.core.util.NumericHelper;
import com.gzh.teaching.service.dto.GetJobIn;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @Author guanzh
 * @Date 2022/1/25 14:06
 * @Description
 */
@Setter
@Getter
@ToString
public class GetJobParam {

    private String courseId;

    private String workId;

    private String userId;

    public GetJobIn paramToIn(Integer currentUserId) {
        GetJobIn in = new GetJobIn();
        in.setCourseId(NumericHelper.toInteger(this.courseId));
        in.setWorkId(NumericHelper.toInteger(this.workId));
        if (this.userId != null){
            in.setUserId(NumericHelper.toInteger(this.userId));
        }else {
            in.setUserId(currentUserId);
        }
        return in;
    }
}
